<?xml version="1.0" encoding="UTF-8" ?>
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:foaf="http://xmlns.com/foaf/0.1/"
    xmlns:calli="http://callimachusproject.org/rdf/2009/framework#">
<head>
    <title resource="?this">{rdfs:label}</title>
    <link rel="help" href="../../callimachus-for-web-developers#Facebook_Authentication" target="_blank" title="Help" />
    <script type="text/javascript">// <![CDATA[
        jQuery(function($) {
            if ($('#secret-link').length) {
                $('#add-secret').hide();
            }
        });
    // ]]>
    </script>
</head>
<body resource="?this">
    <h1 property="rdfs:label" />
    <form role="form" id="rdfForm" method="POST" action="" enctype="application/sparql-update" resource="?this">
        <fieldset>
            <div class="form-group">
                <label for="label">Label</label>
                <div class="controls">
                    <input type="text" class="form-control" id="label" value="{rdfs:label}" required="required" />
                </div>
            </div>
            <div class="form-group">
                <label for="appId">appId</label>
                <div class="controls">
                    <input type="text" class="form-control" id="appId" value="{calli:facebookAppId}" required="required" />
                </div>
            </div>
            <div id="secret" dropzone="link s:text/uri-list" class="form-group"
                    ondrop="if(!event.dataTransfer.getData('text/plain').match(/.xhtml$/)){$('#add-secret').hide();calli.insertResource(event);}return false">
                <label>Secret</label>
                <div rel="calli:facebookSecret" class="controls">
                    <span resource="?secret" typeof="foaf:Document">
                        <a onclick="var dialog = calli.openDialog(this.href,'Facebook App Secret',{onmessage:function(event){if(event.data.indexOf('PUT src\n') == 0)calli.closeDialog(dialog);}});return false"
                            id="secret-link" href="{?secret}?edit" title="{?secret}">Change and view the facebook app secret</a>
                    </span>
                </div>
                <a id="add-secret" href="../pages/facebook-secret.xhtml?view"
                    onclick="return calli.createResource(event)">Provide the Facebook app seceret</a>
            </div>
            <div class="form-group">
                <label for="comment">Comment</label>
                <div class="controls">
                    <textarea id="comment" class="form-control" required="required">{rdfs:comment}</textarea>
                </div>
            </div>
            <div class="form-group">
                <button id="save" type="submit" class="btn btn-primary">Save</button>
                <button id="cancel" type="button" onclick="window.location.replace('?view')" class="btn btn-default">Cancel</button>
                <button id="delete" type="button" onclick="calli.deleteResource(event)" class="btn btn-danger">Delete</button>
            </div>
        </fieldset>
    </form>
</body>
</html>
